#include <stdio.h>

int main() {
    int i, count = 0;
    for (i = 1; i <= 2019; i++)
    {
        int tep = i;
        while (tep)
        {
            if (tep % 10 == 9)
            {
                count++;
                break;
            }
            tep /= 10;
        }
    }
    printf("%d", count);
    return 0;
}